package org.hhchat.leetcode.twoPoints;

/**
 * Created this one by HMH on 2017/10/2.
 */
public class code492_easy {
    static class Solution {
        public int[] constructRectangle(int area) {
            int w = (int) Math.sqrt(area);
            int l = w;
            while (w > 0) {
                long multi = w * l;
                if (multi < area) {
                    l++;
                }
                else if (multi > area) {
                    w--;
                }
                else{
                    break;
                }
            }
            int[] result = new int[2];
            result[0] = l;
            result[1] = w;
            return result;
        }
    }
    public static void main(String[] args){

    }

}
